package com.ewing.web.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.ewing.busi.web.service.CategoryService;
import com.ewing.busi.web.service.TemplateService;
import com.ewing.core.app.action.base.BaseAction;
import com.ewing.core.jdbc.DaoException;

public class PageRenderAction extends BaseAction {
    @Resource
    private CategoryService categoryService;
    @Resource
    private TemplateService templateService;

    public void redirectTemplate() {
        Integer shopId = getIntegerParameter("shopId");
        String page = request.getParameter("page");
        Map<String, Object> dataModel = new HashMap<String, Object>();
        try {
            List<String> groupKeyList = templateService.getTemplateRelGroupKeys(page);
            categoryService.loadCategoryList(groupKeyList, dataModel);
        } catch (DaoException e) {
            e.printStackTrace();
        }
        render(page, dataModel);
    }

}
